//
//  MessageDetailTableViewCell.m
//  Learn
//
//  Created by zyl on 2024/4/3.
//  Copyright © 2024 迟建国. All rights reserved.
//

#import "MessageDetailTableViewCell.h"

@implementation MessageDetailTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    [self.contentView addSubview:self.dateLabel];
    [self.contentView addSubview:self.backView];
    [self.backView addSubview:self.titleLabel];
    [self.backView addSubview:self.subTitleLabel];
    [self.backView addSubview:self.arrowImg];
    self.contentView.backgroundColor = lClearColor;
    self.backgroundColor = lClearColor;
    return self;
}
- (UILabel *)titleLabel
{
    if (!_titleLabel) {
        
        _titleLabel = [[UILabel alloc] init];
        _titleLabel.frame = CGRectMake(10,15,lScreenWidth - 20 - 18 - 10 - 20,22);
        _titleLabel.font = MFontWithSize(16);
        _titleLabel.textColor = rgba(51, 51, 51, 1);
        _titleLabel.textAlignment = NSTextAlignmentLeft;
        _titleLabel.text = @"惠州初中英语";
    
    }
    return _titleLabel;
}
- (UILabel *)subTitleLabel
{
    if (!_subTitleLabel) {
        
        _subTitleLabel = [[UILabel alloc] init];
        _subTitleLabel.frame = CGRectMake(10,47,lScreenWidth - 20 - 10 - 18 - 5,22);
        _subTitleLabel.font = RFontWithSize(14);
        _subTitleLabel.textColor = rgba(142, 142, 142, 1);
        _subTitleLabel.textAlignment = NSTextAlignmentLeft;
        _subTitleLabel.numberOfLines = 0;
        
    
    }
    
    return _subTitleLabel;
}
- (UILabel *)potLabel
{
    if (!_potLabel) {
        
        _potLabel = [[UILabel alloc] init];
        _potLabel.frame = CGRectMake(64,9,16,16);
        _potLabel.font = MFontWithSize(10);
        _potLabel.textColor = lWhiteColor;
        _potLabel.backgroundColor = rgba(250, 25, 44, 1);
        _potLabel.textAlignment = NSTextAlignmentCenter;
        [_potLabel setAllCornersWithCornerRadius:8];
    
    }
    return _potLabel;
}
- (UIImageView *)arrowImg
{
    if (!_arrowImg) {
        _arrowImg = [[UIImageView alloc] initWithFrame:CGRectMake(lScreenWidth - 20 - 18, 19, 8, 14)];
        _arrowImg.image = IMAGENAMED(@"ic_mine_arrow_black");
    }
    return _arrowImg;
}
- (UILabel *)dateLabel
{
    if (!_dateLabel) {
        
        _dateLabel = [[UILabel alloc] init];
        _dateLabel.frame = CGRectMake((lScreenWidth - 120)/2.0,10,120,28);
        _dateLabel.font = RFontWithSize(12);
        _dateLabel.textColor = rgba(181, 181, 181, 1);
        _dateLabel.textAlignment = NSTextAlignmentCenter;
        _dateLabel.text = @"2021-01-30 17:18";
        _dateLabel.backgroundColor = rgba(229, 229, 229, 1);
        [_dateLabel setAllCornersWithCornerRadius:5];
    
    }
    return _dateLabel;
}
- (UIView *)backView
{
    if (!_backView) {
        _backView = [[UIView alloc] initWithFrame:CGRectMake(10, 48, lScreenWidth - 20, 140)];
        _backView.backgroundColor = lWhiteColor;
        [_backView setAllCornersWithCornerRadius:8];
    }
    return _backView;
}
@end
